from utils.client import APIClient
from utils.yaml_config import get_yaml


data = get_yaml('history.yaml')

class Api_History:

    def __init__(self,client:APIClient):
        self.client = client

    def history_front(self):
        history_data = data['front']['request']
        return self.client.request(history_data['method'],history_data['path'])

    def history_info(self):
        history_data = data['info']['request']
        return self.client.request(history_data['method'],history_data['path'])        
    
    def history_get(self):
        history_data = data['get']['request']
        return self.client.request(history_data['method'],history_data['path'])

    def history_top(self):
        history_data = data['top']['request']
        return self.client.request(history_data['method'],history_data['path'])
    
    def history_inner(self):
        history_data = data['inner']['request']
        return self.client.request(history_data['method'],history_data['path'],json=history_data['json'])
    
    def history_get2(self):
        history_data = data['get2']['request']
        return self.client.request(history_data['method'],history_data['path'],json=history_data['json'])
    
    def history_history(self):
        history_data = data['history']['request']
        return self.client.request(history_data['method'],history_data['path'],json=history_data['json'])
    
    def history_curve(self):
        history_data = data['curve']['request']
        return self.client.request(history_data['method'],history_data['path'],json=history_data['json'])